package howe.sudoku.listener;

import howe.sudoku.layout.SudokuListActivity;
import howe.sudoku.names.SudokuName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.util.Log;

public class NewGameDialogListener implements OnClickListener{

    Context context = null;

    public NewGameDialogListener(Context context) {
        this.context = context;
    }

    @Override
    public void onClick(DialogInterface dialog, int which) {
        startGame(which);
    }

    private void startGame(int which) {
        Log.d(SudokuName.TAG, "NewGameDialog clicked on " + which);
        // Start game here...
        Intent intent = new Intent(this.context, SudokuListActivity.class);
        intent.putExtra(SudokuName.KEY_LIST_DIFFICULTY, which);
        context.startActivity(intent);
    }
}
